import java.lang.String;

public class Three {
    public static void main(String[] args) {
        if (args.length < 2)
            return;

        if (convertible2(args[0], args[1]))
            System.out.println("Yes");
        else
            System.out.println("No");
    }

    private static boolean convertible(String a, String b) {
        if (a.length() != b.length())
            return false;

        int[] data = new int[256];

        for (int i = 0; i < a.length(); ++i)
            data[a.charAt(i)]++;

        for (int i = 0; i < b.length(); ++i) {
            char ch = b.charAt(i);
            if (data[ch] == 0)
                return false;
            data[ch]--;
        }
 
        return true;
    }

    private static String sort(String a) {
        char[] array = a.toCharArray();
        java.util.Arrays.sort(array);
        return new String(array);
    }

    private static boolean convertible2(String a, String b) {
        return sort(a).equals(sort(b));
    }
}
